How to fix iisreset error on windows 10?

您所在的位置:网站首页 world wide web publishing service How to fix iisreset error on windows 10?

How to fix iisreset error on windows 10?

2023-03-31 12:26| 来源: 网络整理| 查看: 265

The iisreset command is used to reset Internet Information Services (IIS) on Windows operating systems. However, sometimes when executing this command, users may encounter an error that prevents the IIS service from being reset. This error can be caused by various factors, such as incorrect permissions or a corrupted IIS configuration. In this article, we will discuss some methods to fix the iisreset error on Windows 10.

Method 1: Restart the World Wide Web Publishing Service

To fix the "iisreset error" on Windows 10, you can try restarting the World Wide Web Publishing Service. Here are the steps:

Open the Services console by pressing the Windows key + R, typing "services.msc" and pressing Enter.

Scroll down to find the "World Wide Web Publishing Service" and right-click it.

Click "Stop" to stop the service.

Wait a few seconds, then right-click the service again and click "Start" to restart it.

Once the service has restarted, try running "iisreset" again to see if the error has been resolved.

Here is an example PowerShell script that automates the process:

$serviceName = "W3SVC" $service = Get-Service -Name $serviceName if ($service.Status -eq "Running") { Stop-Service -Name $serviceName Start-Service -Name $serviceName } else { Start-Service -Name $serviceName }

This script checks if the "World Wide Web Publishing Service" is running, stops it if it is, and then starts it again.

Another way to restart the service is by using the command prompt:

Open the command prompt as an administrator.

Type "net stop w3svc" to stop the service.

Wait a few seconds, then type "net start w3svc" to start the service again.

Here is an example batch script that does the same thing:

@echo off net stop w3svc timeout /t 5 /nobreak > nul net start w3svc

This script stops the service, waits for 5 seconds, and then starts it again.

By restarting the World Wide Web Publishing Service, you should be able to fix the "iisreset error" on Windows 10.

Method 2: Reset IIS using Command Prompt with Administrator Privileges

To reset IIS using Command Prompt with Administrator Privileges, follow these steps:

Open Command Prompt as an administrator.

Type the following command and press Enter:

iisreset /stop

This command will stop all IIS related services.

Wait for the process to complete.

Type the following command and press Enter:

iisreset /start

This command will start all IIS related services.

Wait for the process to complete.

Type the following command and press Enter:

iisreset

This command will reset IIS.

Wait for the process to complete.

Here is an example of how to reset IIS using Command Prompt with Administrator Privileges:

C:\WINDOWS\system32>iisreset /stop Attempting stop... Internet services successfully stopped ... World Wide Web Publishing Service (W3SVC) Stopped ... IIS Admin Service Stopped C:\WINDOWS\system32>iisreset /start Attempting start... Internet services successfully restarted ... World Wide Web Publishing Service (W3SVC) Started ... IIS Admin Service Started C:\WINDOWS\system32>iisreset Attempting stop... Internet services successfully stopped ... World Wide Web Publishing Service (W3SVC) Stopped ... IIS Admin Service Stopped Attempting start... Internet services successfully restarted ... World Wide Web Publishing Service (W3SVC) Started ... IIS Admin Service Started C:\WINDOWS\system32>

In this example, the first command stops all IIS related services. The second command starts all IIS related services. The third command resets IIS. The output shows the status of each service before and after the commands are executed.

Note that resetting IIS will cause all active connections to be terminated. Use this method with caution and only when necessary.

I hope this helps you fix the "Iis: how to fix iisreset error on windows 10?" problem with "Reset IIS using Command Prompt with Administrator Privileges".

Method 3: Use the IIS Manager to Reset IIS

To fix the "iisreset" error on Windows 10, you can use the IIS Manager to reset IIS. Here are the steps to do so:

Open the IIS Manager by searching for "IIS Manager" in the Start menu.

In the left-hand pane, click on the server name to select it.

In the middle pane, click on "Restart" under the "Actions" section.

In the "Restart IIS" dialog box, select the appropriate options for your needs.

Click "OK" to restart IIS.

Here is an example of code to restart IIS using the IIS Manager:

Import-Module WebAdministration Restart-WebAppPool -Name "DefaultAppPool"

This code will restart the "DefaultAppPool" application pool in IIS.

Another example of code to reset IIS using the IIS Manager is:

Import-Module WebAdministration Restart-Service W3SVC

This code will restart the World Wide Web Publishing Service (W3SVC), which will reset IIS.

In summary, to fix the "iisreset" error on Windows 10, you can use the IIS Manager to reset IIS. You can do this by following the steps outlined above or by using PowerShell code examples to restart the appropriate application pool or service.

Method 4: Repair or Reinstall IIS

If you are facing issues with iisreset command on Windows 10, you can try repairing or reinstalling IIS to fix the issue. Here are the steps to do so:

Step 1: Open Control Panel

Click on the Start menu and search for "Control Panel". Click on it to open the Control Panel.

Step 2: Uninstall IIS

In the Control Panel, click on "Programs" and then click on "Programs and Features". Here, you will see a list of installed programs. Look for "Internet Information Services" and click on it. Then, click on "Uninstall/Change" and follow the instructions to uninstall IIS.

Step 3: Reinstall IIS

Once IIS is uninstalled, you can reinstall it by following these steps:

Step 3.1: Install IIS

Click on the Start menu and search for "Turn Windows features on or off". Click on it to open the "Windows Features" window. Here, you will see a list of features that you can turn on or off. Look for "Internet Information Services" and expand it. Check all the boxes under it and click on "OK". This will install IIS on your system.

Step 3.2: Register ASP.NET

Open a command prompt as an administrator and run the following command:

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

This will register ASP.NET with IIS.

Step 3.3: Restart IIS

Open a command prompt as an administrator and run the following command:

iisreset

This will restart IIS and hopefully fix the iisreset error on your system.

Conclusion

In this tutorial, we have seen how to fix iisreset error on Windows 10 with Repair or Reinstall IIS. We uninstalled IIS, reinstalled it, registered ASP.NET with IIS, and restarted IIS to fix the issue.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3